<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>

<body>
	<input type="button" value="button" data-color="red" data-id="1">
	<a href="www.baidu.com" data-ID="2" data-wzname="wz">访问百度</a>
	<p>我在<time datetime="2019-02-25" data-id="3" data-wzname="wz">星期一</time>工作</p>
	<title dir="ltr" data-id="4" data-time="today">任务</title>
	<div id="firdiv" data-id="5" data-class="myfirdiv" data-style="color:red"></div>
	<h1 style="color:black" data-id="6" data-time="12">这是一级标题</h1>
	<em id="7" data-my="wz" data-type="em">工作</em>
	<strong id="8" data-my="wz" data-type="strong">begin</strong>
	<form action="my.html" data-id="9" data-value="Mike">
		First name: <input type="text" name="fname" value="Mickey" />
	</form>
	<b id="10" style="color:chartreuse" data-my="wz" data-type="em">second</b>
	<canvas height="200" id="11" data-id="11" data-hei="100"></canvas>
	<address id="12" data-name="wz" data-dir="south">中国郑州</address>
	<audio src="someaudio.wav" controls data-id="13" data-type="audio"></audio>
	<bdo dir="rtl" id="14" data-name="文本显示方向" data-type="bdo">Here is some text</bdo>
	<cite id="15" data-author="history" data-time="1949">Citation</cite>
	<input type="text" id="fir" onblur="x()">
	<input type="text" id="sec">
	<button onclick="add()">加</button>
	<button onclick="compare()">比较</button>
	<input type="text" id="fname" onfocus="setStyle(this.id)">
	<input type="text" id="lname" onblur="set2Style(this.id)">
	<p id="p1" onmousedown="mouseDown()" onmouseup="mouseUp()">点击文档</p>

</body>
<script>
	function x() {
		var x = document.getElementById("fir").value;
		alert(x);
	}
	function add() {
		var add = document.getElementById('fir').value + document.getElementById('sec').value;
		alert(add);
	}
	function adcompare(x, y) {
		if (x > y) {
			return x;
		} else {
			return y;
		}
	}
	function setStyle(x) {
		document.getElementById(x).style.background = "yellow";
	}
	function set2Style(x) {
		document.getElementById(x).style.background = "red";
	}
	function mouseDown() {
		document.getElementById("p1").style.color = "red";
	}
	function mouseUp() {
		document.getElementById("p1").style.color = "black"
	}
</script>

</html>